package cn.turing.ssm.service;

import cn.turing.ssm.entity.UserInfo;
import cn.turing.ssm.mapper.UserInfoMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.concurrent.Executors;

/**
 * @ClassName UserService
 * @Description: TODO
 * @Author gmllt20171110
 * @Date 2020/1/24
 * @Version V1.0
 **/
@Service
public class UserInfoService
{
    @Resource
    private UserInfoMapper userInfoMapper;

    @Transactional(rollbackFor = Exception.class)
    public void initUserInfo()
    {
        for(int i=0;i<10;i++)
        {
            UserInfo userInfo=new UserInfo();
            userInfo.setUsername("admin"+i);
            userInfo.setPassword("password"+i);
            userInfo.setTruename("truename"+i);
            userInfo.setPhone("phone"+i);
            userInfo.setPower(""+i);
            userInfo.setDepartmentId(13);

            userInfoMapper.add(userInfo);
        }

    }
}
